package com.zdemo.jvm;

public class GCTest {
	
	public static final int _1MB = 1024 * 1024;
	
	@SuppressWarnings("unused")
	public static void testTenuringThreshold1() {

		byte[] allocation1, allocation2, allocation3, allocation4;
		
		allocation1 = new byte[_1MB / 4];
		allocation2 = new byte[_1MB * 4];
		allocation3 = new byte[_1MB * 4];
		allocation3 = null;
		allocation3 = new byte[_1MB * 4];
	}
	
	@SuppressWarnings("unused")
	public static void testTenuringThreshold2() {

		byte[] allocation1, allocation2, allocation3, allocation4;
		
		allocation1 = new byte[_1MB / 6];
		allocation2 = new byte[_1MB / 6];
		allocation3 = new byte[_1MB * 4];
		allocation4 = new byte[_1MB * 4];
		allocation4 = null;
		allocation4 = new byte[_1MB * 4];
	}
	
	public static void main(String[] args) {
		testTenuringThreshold2();
	}

	
}
